function stockRevenue(stockRevenue){
	var myChart = echarts.init(document.getElementById('yysrjzs'));
	stockRevenue = JSON.parse(stockRevenue);
	//stockRevenue = jQuery.parseJSON(stockRevenue);
	//console.log(stockRevenue);
	//console.log(stockRevenue.data)
	//console.log(typeof stockRevenue.data)
	
	var list = stockRevenue.data;
	var time = [];//时间
	var revenues = [];
	var revenueYOY = [];//同比增长（左轴）
	for (var i = 0; i < list.length; i++) {
		time.push(list[i].year);
		revenues.push(unitConvert(list[i].revenue));
		if(!list[i].revenueYOY){
			revenueYOY.push("-");
		}else{
			revenueYOY.push(list[i].revenueYOY.toFixed(2));
		}
	}
	var revenuess = [];//营业收入及增速
	for(var i=0,l=revenues.length;i<l;i++){
		revenuess.push(revenues[i].num)
	}
	
	var max = Math.max.apply(null,revenuess) + 20;
	var min = Math.max.apply(null,revenueYOY) + 20;
	
	option = {
		    title: {
		        text: '营业收入及增速',
		        //subtext: '纯属虚构'
		    },
		    tooltip: {
		        trigger: 'axis',
		        axisPointer: {
		            type: 'cross',
		            label: {
		                backgroundColor: '#283b56'
		            }
		        }
		    },
		    legend: {
		    	x: '50%',
		        top: '',
		        bottom: '',
		        //icon: "circle",
		        data:['同比增长（左轴）', '营业收入'],
		        textStyle: {
                    fontSize: 12,
                    color: '#3e4956'
                }
		    },
		    dataZoom: {
		        show: false,
		        start: 0,
		        end: 100
		    },
		    xAxis: [
		        {
		            type: 'category',
		            boundaryGap: true,
		            data: (function (){
		                var res = time;
		                return res;
		            })()
		        },
		        {
		            type: 'category',
		            boundaryGap: true,
		            data: (function (){
		                var res = time;
		                return res;
		            })()
		        }
		    ],
		    yAxis: [
		        {
		            type: 'value',
		            scale: true,
		            name: '%',
		            max: min,
		            min: 0,
		            boundaryGap: [0.2,0.2],
		            formatter: '{value} %'  
		        },
		        {
		            type: 'value',
		            scale: true,
		            name: '亿',
		            max: max,
		            min: 0,
		            boundaryGap: [0.2, 0.2]
		        }
		    ],
		    series: [
		        {
		            name:'营业收入',
		            type:'bar',
		            xAxisIndex: 1,
		            yAxisIndex: 1,
		            itemStyle: {
                        normal: {
                            color: 'rgb(18, 131, 213)'
                        }
                    },
		            data:(function (){
		                var res = revenuess;
		                return res;
		            })()
		        },
		        {
		            name:'同比增长（左轴）',
		            type:'line',
		            itemStyle: {
                        normal: {
                            color: 'rgb(70, 227, 232)'
                        }
                    },
		            data:(function (){
		                var res = revenueYOY;
		                return res;
		            })()
		        }
		    ]
		};


	if (option && typeof option === "object") {
	    myChart.setOption(option, true);
	}
	
}


function strNumSize(tempNum) {
    var stringNum = tempNum.toString();
    var index = stringNum.indexOf(".");
    var newNum = stringNum;
    if(index != -1) {
        newNum = stringNum.substring(0, index)
    };
    return newNum.length;
}
function unitConvert(num) {
    var moneyUnits = ["", "万", "亿", "万亿"];
    var dividend = 10000;
    var curentNum = num;
    //转换数字
    var curentUnit = moneyUnits[0];
    //转换单位 
    for(var i = 0; i < 4; i++) {
        curentUnit = moneyUnits[i];
        if(strNumSize(curentNum) < 5) {
            break;
        };
        curentNum = curentNum / dividend;
    };
    var m = {
        num: 0,
        unit: ""
    };
    m.num = curentNum.toFixed(2);
    m.unit = curentUnit;
    return m;
}